#ifndef __MYIIC_0_H
#define __MYIIC_0_H
#include "stm32f1xx_hal.h"
#include "stdio.h"
#include "main.h"
#include "math.h"
#include "string.h"
#include "usart.h"
#include "system.h"
#include "bsp_PCA9685.h"
#include "bsp_PCA9685_0.h"

#define test_servo 0
#define multiple 1
#define theta_tibia_defaut 0
#define theta_femur_defaut 30
#define theta_coxa_defaut 0

extern uint8_t pstwo_control;
extern char Servo[18];
extern float HOME_X[6];
extern float HOME_Y[6];
extern float HOME_Z[6];
extern float BODY_Z[6];
extern float COXA_LENGTH;           //leg part lengths
extern float FEMUR_LENGTH;
extern float TIBIA_LENGTH;

int Angle_Change(int angle);

void action_init(void);
void Gait_plan(void);
void Gait_update(int Blue_x,int Blue_y,int Blue_z,uint8_t Blue_mode);
void Forward(int leg_number,float X,float Y,float Z);
void Turn_left(void);
void Turn_right(void);
void Left_Tynanize(void);
void Right_Tynanize(void);
void Back(void);
void compute_strides(void); 
void compute_amplitudes(void);
void Stop(void);
long map(long x, long in_min, long in_max, long out_min, long out_max);
int constrain(int value, int minValue, int maxValue);
#endif
















